A basic janitor service to handle recurring tasks - part 1#322
Merged
jonasbardino merged 17 commits intonextfrom Sep 26, 2025
Merged
Conversation
b598fc9 to
b41ed8c
Compare
This was
linked to
issues
Sep 3, 2025
3e41412 to
e5d721d
Compare
This was
unlinked from
issues
Sep 4, 2025
ee9cace to
ac3367a
Compare
b5efa49 to
b50a697
Compare
rasmunk
reviewed
Sep 26, 2025
| check_enabled "janitor" || return | ||
| DAEMON_PATH=${MIG_JANITOR} | ||
| SHORT_NAME=$(basename ${DAEMON_PATH}) | ||
| PID_FILE="$PID_DIR/${SHORT_NAME}.pid" |
Contributor
There was a problem hiding this comment.
PID_FILE doesn't appear to be used here?
Contributor
Author
There was a problem hiding this comment.
Thanks, that looks true.
It's a simple copy/paste of what we do for all the other migrid service daemons, and AFAICT the PID_FILE is only directly used in the corresponding deb (Debian/Ubuntu) template. It should perhaps be used on rh (RHEL/Rocky), too, but that would be something to handle and test thoroughly in a separate PR.
Contributor
Author
There was a problem hiding this comment.
I'll add a TODO about it in the template.
b50a697 to
376a682
Compare
rasmunk
reviewed
Sep 26, 2025
rasmunk
approved these changes
Sep 26, 2025
…next` branch for further development.
…it. The previous commit only had the polished skeleton in place.
…g on reset token validity. Prepared for automatic handling of other trivial requests like renewal with valid peer or rejection of obviously invalid requests. Minor adjustment to skip subdirs when cleaning files in state dirs.
…jection of expired account requests. Elaborate on reject reasons. Extend infrastructure to allow rejection of obviously invalid requests based e,g, on detection during submit. In that way we can check e.g. valid password for expired accounts during submit but delay actual rejection until janitor picks it up with sufficient delay to avoid introducing a trivial password cracking mechanism in the account request forms. We can similarly test early if a requested peer has an account and reject in janitor if not.
- requests for renew with existing user ID collisions - requests for renew with unauthorized password change - requests for renew of suspended/blocked accounts - requests with insufficient peers info - requests with expire set in the past - requests with invalid full name Polished some style bits and stripped some undesired newlines in log entries.
…d make the daemon itself very shallow.
`black $TARGET` and `isort --line-length=80 -m=HANGING_INDENT $TARGET` to each file in the new sbin/ and mig/lib/ dirs for cleanliness.
functionality to ease support load.
…tuple init of the `title_entry['container_class']`.
…e case of triggering next run in otherwise idle daemons.
…e recently added daemon helpers for the purpose. Should also make the daemon a lot more responsive to the normal SIGINT shutdown signal.
…logically True function object itself. Thanks @rasmunk for catching and reporting that important little detail.
e51f9e3 to
34b75d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A standalone
grid_janitorservice as outlined in the linked milestone to eventually handle a range of recurring tasks better done in a long-running background process. The core service is implemented and functional and this first iteration mainly handles pruning of account requests. State clean up and cache updates are pending in follow-up parts. Input and comments are of course welcome.This work was originally started as PR #215 but since ported to
nextbranch for further development.